//
//  WBBaseTableViewController.swift
//  weibo
//
//  Created by chenguanglei on 16/11/25.
//  Copyright © 2016年 itheima. All rights reserved.
//

import UIKit


class WBBaseTableViewController: UITableViewController,WBVisitorViewDelegate {

    let visitorView = WBVisitorView()
    
    //属性记录登陆状态
    var isLogin : Bool  {
    
        return WBUserAccount.shareInstance.isLogin
    
    }
    
    override func loadView() {
        
        isLogin ? (super.loadView()):(setupVisitor())
        
    }
    
    
    private func setupVisitor(){
    
        view = visitorView

        visitorView.delegate = self
        
        visitorView.backgroundColor = UIColor.yellow
    }
    
    
    func registerButtonClick() {
        
        
        let oauth = WBOAuthViewController()
        
        let nav = UINavigationController(rootViewController: oauth)
        
        present(nav, animated: true, completion: nil)
        
    }
    
    
    func loginButtonClick() {
        
        
        print("登陆")
        
    }
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        
        
    }

   
}
